package com.cwd.arm.common.exception;

import com.cwd.arm.common.enums.ErrorEnum;
import lombok.Data;

/**
 * Created by yan on 21-12-4.
 */
@Data
public class ArmException extends RuntimeException{

    private Integer code;
    private String msg;

    public ArmException(ErrorEnum errorEnum,String msg) {
        super(msg);
        this.msg = msg;
        this.code = errorEnum.getCode();
    }

    public ArmException(String msg) {
        super(msg);
        this.msg = msg;
        this.code = ErrorEnum.ERROR.getCode();
    }

    public ArmException() {
        super(ErrorEnum.ERROR.getName());
        this.msg = ErrorEnum.ERROR.getName();
        this.code = ErrorEnum.ERROR.getCode();
    }
}
